<template>
  <div id="changepassword-page">
    <div class="page-title">
      <i class="icon iconfont icon-iconfontjiantou1" @click="$router.back()"></i>
      <span>我的收藏</span>
    </div>
    <div  style="padding-top: 50px" >
      <product-list-item v-for="(product,index) in productList" :key="index" :show-type="3" :curr-product="product" :change-call-back="getProductCollectList"/>
      <div  v-if="productList.length===0" class="no-data">
        暂无【收藏】数据....
      </div>
    </div>

  </div>
</template>

<script>
import ProductListItem from "../common/ProductListItem";
export default {
  name: "ProductCollectList",
  components: {ProductListItem},
  data:function (){
    return {
      productList:[],
      loading:false
    }
  },
  mounted() {
    this.getProductCollectList()
  },
  methods:{
    getProductCollectList:function () {
      let $this = this
      $this.collectLoading=true
      $this.MyRequest($this.ApiDoNameMember + 'Member/getProductList', {}, function (data) {
        var productList=[]
        data.list.forEach(function (value, index) {
          productList.push({
            id:value.productId,
            name:value.productName,
            image:value.productImage,
            price:value.productPrice,
          })
        })
        $this.productList=productList
        $this.$forceUpdate()
      }, function (msg) {
        $this.collectLoading=false
        $this.$message.error(msg)
      })
    }
  }
}
</script>

<style scoped>

</style>
